package pl.edu.pw.perg.compinfodb.xls;


@SuppressWarnings("serial")
public class InvalidMetadataFormatException extends RuntimeException {

	private static final String BAR = "-------------------------";
	private XLSMetadataReader.XLSSheets sheet;
	
	public InvalidMetadataFormatException(String message, XLSMetadataReader.XLSSheets sheetName, String col, int row){
		super(BAR +"\n" +
				"Invalid format!" + 
					"\nSheet: " + sheetName.getName() +"\nColumn: " +
				col + "\nRow: " + (row + 1) +".\n" + message + "\n" +
				BAR);
		sheet = sheetName;
	}
	
	public InvalidMetadataFormatException(String message, XLSMetadataReader.XLSSheets sheetName){
		super(BAR + "\n" +
				"Invalid format!" +
				"\nSheet: " + sheetName.getName() +". \n"
				+ message + "\n" + BAR);
		sheet = sheetName;
	}
	
	public InvalidMetadataFormatException(String message, XLSMetadataReader.XLSSheets sheetName, String col,
			int row, Throwable cause){
		super(BAR + "\n" +
				"Invalid format!" +
				"\nSheet: " + sheetName.getName() +
				"\nColumn: " +
				col + 
				"\nRow: " + (row + 1) +".\n" + message +
				"\n" + BAR, cause);
		sheet = sheetName;
	}

	public XLSMetadataReader.XLSSheets getSheet() {
		return sheet;
	}
}
